//
//  Person.m
//  demo
//
//  Created by zhouxiaobo on 15/10/20.
//  Copyright © 2015年 mapath. All rights reserved.
//

#import "Person.h"

@implementation Person

- (id) init{
    if(self = [super init]){
        age = 30;
        height = 178.0;
        name = @"zhangsan";
    }
    return self;
}

- (id) initWithAge:(int)newAge{
    if(self = [super init]){
        age = newAge;
        height = 178.0;
        name = @"zhangsan";
    }
    return self;
}

- (id) initWithAge:(int)newAge andHeight:(float)newHeight{
    if(self = [super init]){
        age = newAge;
        height = newHeight;
        name = @"zhangsan";
    }
    return self;
}

- (void)setAge:(int)newAge{
    age = newAge;
}

- (void)setHeight:(float)newHeight{
    height = newHeight;
}

- (void)setName:(NSString *)newName{
    name = newName;
}


- (void)setMac:(Mac *)newMac{
    mac = newMac;
}

- (int)getAge{
    return age;
}

- (float)getHeight{
    return height;
}

- (NSString *)getName{
    return name;
}

-(Mac *) getMac{
    return mac;
}

-(void) studyOCWith:(Mac *)macbook{
    [macbook on];
    [macbook operate:name];
    [macbook off];
}

+(Person *)getInstance{
    return [[self alloc]init];
}

@end
